package com.myExam.base.db;

import com.myExam.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class DictionaryMain extends Activity {

	EditText editText;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.base_db_dictionary);
	    
	    editText = (EditText)findViewById(R.id.DictionaryMain_inputWord);
	    Button btn = (Button)findViewById(R.id.DictionaryMain_searchBtn);
	    
	    btn.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				if((editText.getText().toString()).equals("")){
					Toast.makeText(getBaseContext(), "Input Search word", 1).show();
					
				} else {
					Intent intent = new Intent(DictionaryMain.this, DictionaryProc.class);
					Bundle myData = new Bundle();
					
					myData.putString("key", editText.getText().toString());
					intent.putExtras(myData);
					startActivity(intent);
				}
			}
		});
	
	}

}
